<!doctype html>



  


<html class="theme-next muse use-motion">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />












  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  
    
      
    

    
  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Microsoft YaHei:300,300italic,400,400italic,700,700italic|consolas:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.4.0" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.0.2" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="js," />








  <link rel="shortcut icon" type="image/x-icon" href="http://ofy7k3v4s.bkt.clouddn.com/mylogo.png?v=5.0.2" />






<meta name="description" content="JavaScript &amp;#x89E3;&amp;#x91CA;&amp;#x5668;&amp;#x4F1A;&amp;#x5C06;&amp;#x8868;&amp;#x8FBE;&amp;#x5F0F;&amp;#x8BA1;&amp;#x7B97;&amp;#x51FA;&amp;#x4E00;&amp;#x4E2A;&amp;#x7ED3;&amp;#x679C;&amp;#xFF0C;&amp;#x7A0B;&amp;#x5E8F;&amp;#x4E2D;&amp;#x6700;&amp;#x5E38;&amp;#x89C1;&amp;#x7684;&amp;#x53">
<meta property="og:type" content="article">
<meta property="og:title" content="js 表达式和运算符">
<meta property="og:url" content="https://hongqinma.github.io/2014/03/28/js-表达式和运算符/index.html">
<meta property="og:site_name" content="HongqinMa' Blog">
<meta property="og:description" content="JavaScript &amp;#x89E3;&amp;#x91CA;&amp;#x5668;&amp;#x4F1A;&amp;#x5C06;&amp;#x8868;&amp;#x8FBE;&amp;#x5F0F;&amp;#x8BA1;&amp;#x7B97;&amp;#x51FA;&amp;#x4E00;&amp;#x4E2A;&amp;#x7ED3;&amp;#x679C;&amp;#xFF0C;&amp;#x7A0B;&amp;#x5E8F;&amp;#x4E2D;&amp;#x6700;&amp;#x5E38;&amp;#x89C1;&amp;#x7684;&amp;#x53">
<meta property="og:image" content="https://hongqinma.github.io/2014/03/28/js-表达式和运算符/6.3.png">
<meta property="og:image" content="https://hongqinma.github.io/2014/03/28/js-表达式和运算符/s09.1.jpg">
<meta property="og:updated_time" content="2016-11-07T15:02:40.107Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="js 表达式和运算符">
<meta name="twitter:description" content="JavaScript &amp;#x89E3;&amp;#x91CA;&amp;#x5668;&amp;#x4F1A;&amp;#x5C06;&amp;#x8868;&amp;#x8FBE;&amp;#x5F0F;&amp;#x8BA1;&amp;#x7B97;&amp;#x51FA;&amp;#x4E00;&amp;#x4E2A;&amp;#x7ED3;&amp;#x679C;&amp;#xFF0C;&amp;#x7A0B;&amp;#x5E8F;&amp;#x4E2D;&amp;#x6700;&amp;#x5E38;&amp;#x89C1;&amp;#x7684;&amp;#x53">
<meta name="twitter:image" content="https://hongqinma.github.io/2014/03/28/js-表达式和运算符/6.3.png">



<script type="text/javascript" id="hexo.configuration">
  var NexT = window.NexT || {};
  var CONFIG = {
    scheme: 'Muse',
    sidebar: {"position":"left","display":"post"},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '6347850919329138000',
      author: 'Hiraku'
    }
  };
</script>




  <link rel="canonical" href="https://hongqinma.github.io/2014/03/28/js-表达式和运算符/"/>


  <title> js 表达式和运算符 | HongqinMa' Blog </title>
</head>

<body itemscope itemtype="//schema.org/WebPage" lang="en">

  



  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "//hm.baidu.com/hm.js?10010323";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>








  
  
    
  

  <div class="container one-collumn sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="//schema.org/WPHeader">
      <div class="header-inner"><div class="site-meta custom-logo">
  
    <div class="site-meta-headline">
      <a>
        <img class="custom-logo-image" src="http://ofy7k3v4s.bkt.clouddn.com/photo.jpg"
             alt="HongqinMa' Blog"/>
      </a>
    </div>
  

  <div class="custom-logo-site-title">
    <a href="/"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">HongqinMa' Blog</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
  <p class="site-subtitle">Spell at all costs， to rush you in the future。</p>
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            Home
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            Categories
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            Archives
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            Tags
          </a>
        </li>
      

      
    </ul>
  

  
</nav>

 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  
  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="//schema.org/Article">

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                js 表达式和运算符
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            <span class="post-meta-item-icon">
              <i class="fa fa-calendar-o"></i>
            </span>
            <span class="post-meta-item-text">Posted on</span>
            <time itemprop="dateCreated" datetime="2014-03-28T09:10:05+08:00" content="2014-03-28">
              2014-03-28
            </time>
          </span>

          
            <span class="post-category" >
              &nbsp; | &nbsp;
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">In</span>
              
                <span itemprop="about" itemscope itemtype="https://schema.org/Thing">
                  <a href="/categories/JavaScript/" itemprop="url" rel="index">
                    <span itemprop="name">JavaScript</span>
                  </a>
                </span>

                
                

              
            </span>
          

          
            
              <span class="post-comments-count">
                &nbsp; | &nbsp;
                <a href="/2014/03/28/js-表达式和运算符/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count ds-thread-count" data-thread-key="2014/03/28/js-表达式和运算符/" itemprop="commentsCount"></span>
                </a>
              </span>
            
          

          

          
          
             <span id="/2014/03/28/js-表达式和运算符/" class="leancloud_visitors" data-flag-title="js 表达式和运算符">
               &nbsp; | &nbsp;
               <span class="post-meta-item-icon">
                 <i class="fa fa-eye"></i>
               </span>
               <span class="post-meta-item-text">visitors </span>
               <span class="leancloud-visitors-count"></span>
              </span>
          

          
              &nbsp; | &nbsp;
              <span class="page-pv"><i class="fa fa-file-o"></i>
              <span class="busuanzi-value" id="busuanzi_value_page_pv" ></span>
              </span>
          

          
          <span id="busuanzi_container_page_pv">  <span id="busuanzi_value_page_pv"></span> Views</span>
          
        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>JavaScript &#x89E3;&#x91CA;&#x5668;&#x4F1A;&#x5C06;&#x8868;&#x8FBE;&#x5F0F;&#x8BA1;&#x7B97;&#x51FA;&#x4E00;&#x4E2A;&#x7ED3;&#x679C;&#xFF0C;&#x7A0B;&#x5E8F;&#x4E2D;&#x6700;&#x5E38;&#x89C1;&#x7684;&#x53D8;&#x91CF;&#x5C31;&#x662F;&#x4E00;&#x79CD;&#x8868;&#x8FBE;&#x5F0F;&#x3002;<br>&#x53D8;&#x91CF;&#x540D;&#x4E5F;&#x662F;&#x4E00;&#x79CD;&#x8868;&#x8FBE;&#x5F0F;&#x3002;&#x590D;&#x6742;&#x8868;&#x8FBE;&#x5F0F;&#x662F;&#x7531;&#x7B80;&#x5355;&#x8868;&#x8FBE;&#x5F0F;&#x7EC4;&#x6210;&#x7684;&#xFF0C;&#x6700;&#x5E38;&#x7528;&#x7684;&#x65B9;&#x6CD5;&#x662F;&#x4F7F;&#x7528;&#x8FD0;&#x7B97;&#x7B26;&#x3002;</p>
<h2 id="&#x8868;&#x8FBE;&#x5F0F;"><a href="#&#x8868;&#x8FBE;&#x5F0F;" class="headerlink" title="&#x8868;&#x8FBE;&#x5F0F;"></a>&#x8868;&#x8FBE;&#x5F0F;</h2><h3 id="&#x539F;&#x59CB;&#x8868;&#x8FBE;&#x5F0F;"><a href="#&#x539F;&#x59CB;&#x8868;&#x8FBE;&#x5F0F;" class="headerlink" title="&#x539F;&#x59CB;&#x8868;&#x8FBE;&#x5F0F;"></a>&#x539F;&#x59CB;&#x8868;&#x8FBE;&#x5F0F;</h3><p>&#x539F;&#x59CB;&#x8868;&#x8FBE;&#x5F0F;&#x662F;&#x8868;&#x8FBE;&#x5F0F;&#x7684;&#x6700;&#x5C0F;&#x5355;&#x4F4D;&#xFF0C;&#x901A;&#x5E38;&#x5305;&#x542B;&#xFF1A;</p>
<ul>
<li>&#x5E38;&#x91CF;</li>
<li>&#x76F4;&#x63A5;&#x91CF;</li>
<li>&#x5173;&#x952E;&#x5B57;</li>
<li>&#x53D8;&#x91CF;</li>
</ul>
<h4 id="&#x5BF9;&#x8C61;&#x548C;&#x6570;&#x7EC4;&#x7684;&#x521D;&#x59CB;&#x5316;&#x8868;&#x8FBE;&#x5F0F;"><a href="#&#x5BF9;&#x8C61;&#x548C;&#x6570;&#x7EC4;&#x7684;&#x521D;&#x59CB;&#x5316;&#x8868;&#x8FBE;&#x5F0F;" class="headerlink" title="&#x5BF9;&#x8C61;&#x548C;&#x6570;&#x7EC4;&#x7684;&#x521D;&#x59CB;&#x5316;&#x8868;&#x8FBE;&#x5F0F;"></a>&#x5BF9;&#x8C61;&#x548C;&#x6570;&#x7EC4;&#x7684;&#x521D;&#x59CB;&#x5316;&#x8868;&#x8FBE;&#x5F0F;</h4><ul>
<li>&#x6570;&#x7EC4;&#x8868;&#x8FBE;&#x5F0F;<ul>
<li><code>[]</code></li>
<li><code>[1+2,3+1]</code></li>
<li><code>var matrix = [[1,2,3],[1,2,2],[2,3,1]];</code></li>
<li><code>[0,,,1]</code></li>
</ul>
</li>
<li>&#x5BF9;&#x8C61;&#x8868;&#x8FBE;&#x5F0F;<ul>
<li><code>var p = {name: &quot;Hiraku&quot;, age: 17};</code></li>
<li><code>var q = {};</code></li>
<li><code>q.x = 2.3</code></li>
<li><code>var data = {casData:{cas: canvas, ctx: context}, lineData{lineStyle:&quot;red&quot;,lineWidth:2}}</code></li>
</ul>
</li>
<li>&#x51FD;&#x6570;&#x5B9A;&#x4E49;&#x8868;&#x8FBE;&#x5F0F;<ul>
<li><code>var square = function(x){ return x * x};</code></li>
</ul>
</li>
<li>&#x8BBF;&#x95EE;&#x5BF9;&#x8C61;&#x5C5E;&#x6027;&#x7684;&#x65B9;&#x5F0F;<ul>
<li>obj.key;</li>
<li>obj[key];</li>
</ul>
</li>
<li>&#x8C03;&#x7528;&#x8868;&#x8FBE;&#x5F0F;: &#x51FD;&#x6570;&#x8868;&#x8FBE;&#x5F0F;&#x5F00;&#x59CB;&#xFF0C;&#x8FD9;&#x4E2A;&#x51FD;&#x6570;&#x8868;&#x8FBE;&#x5F0F;&#x6307;&#x4EE3;&#x4E86;&#x8981;&#x8C03;&#x7528;&#x7684;&#x51FD;&#x6570;&#xFF0C;&#x51FD;&#x6570;&#x8868;&#x8FBE;&#x5F0F;&#x540E;&#x662F;&#x4E00;&#x5BF9;&#x5706;&#x62EC;&#x53F7;&#xFF0C;&#x62EC;&#x53F7;&#x5185;&#x662F;&#x4EE5;&#x9017;&#x53F7;&#x9694;&#x5F00;&#x7684;&#x53C2;&#x6570;&#xFF1B;<ul>
<li><code>f(0);</code></li>
<li><code>Math.max(1,2,3);</code></li>
</ul>
</li>
<li>&#x5BF9;&#x8C61;&#x521B;&#x5EFA;&#x8868;&#x8FBE;&#x5F0F;<ul>
<li><code>new Object()</code></li>
<li><code>new Point(1,3)</code></li>
<li>&#x65E0;&#x53C2;&#x6570;&#x65F6;()&#x53EF;&#x4EE5;&#x7701;&#x7565;&#xFF1A; <code>new Object</code></li>
</ul>
</li>
</ul>
<h2 id="&#x8FD0;&#x7B97;&#x7B26;"><a href="#&#x8FD0;&#x7B97;&#x7B26;" class="headerlink" title="&#x8FD0;&#x7B97;&#x7B26;"></a>&#x8FD0;&#x7B97;&#x7B26;</h2><p>ECMAScript &#x63CF;&#x8FF0;&#x4E86;&#x4E00;&#x7EC4;&#x7528;&#x4E8E;&#x64CD;&#x4F5C;&#x6570;&#x7EC4;&#x7684;&#x64CD;&#x4F5C;&#x7B26;&#xFF0C;&#x5206;&#x4E3A;&#x7B97;&#x672F;&#x64CD;&#x4F5C;&#x7B26;&#x3001;&#x4F4D;&#x64CD;&#x4F5C;&#x7B26;&#x3001;&#x5173;&#x7CFB;&#x64CD;&#x4F5C;&#x7B26;&#x5408;&#x76F8;&#x7B49;&#x64CD;&#x4F5C;&#x7B26;&#x3002;<br>&#x5BF9;&#x4E8E;&#x5BF9;&#x8C61;&#xFF0C;&#x76F8;&#x5E94;&#x7684;&#x64CD;&#x4F5C;&#x7B26;&#x901A;&#x5E38;&#x90FD;&#x4F1A;&#x8C03;&#x7528;&#x5BF9;&#x8C61;&#x7684; valueOf() &#x65B9;&#x6CD5;&#x6216;&#x8005; toString() &#x65B9;&#x6CD5;&#x3002;</p>
<h3 id="&#x6BD4;&#x8F83;&#x3001;typeof&#x3001;-&#x3001;-&#x3001;-&#x3001;-&#x3001;-&#x3001;-&#x3001;-&#x3001;-&#x3001;&#x4E09;&#x5143;&#x3001;&#x903B;&#x8F91;&#x8FD0;&#x7B97;&#x7B26;"><a href="#&#x6BD4;&#x8F83;&#x3001;typeof&#x3001;-&#x3001;-&#x3001;-&#x3001;-&#x3001;-&#x3001;-&#x3001;-&#x3001;-&#x3001;&#x4E09;&#x5143;&#x3001;&#x903B;&#x8F91;&#x8FD0;&#x7B97;&#x7B26;" class="headerlink" title="&#x6BD4;&#x8F83;&#x3001;typeof&#x3001;+&#x3001;-&#x3001;*&#x3001;/&#x3001;%&#x3001;=&#x3001;==&#x3001;===&#x3001;&#x4E09;&#x5143;&#x3001;&#x903B;&#x8F91;&#x8FD0;&#x7B97;&#x7B26;"></a>&#x6BD4;&#x8F83;&#x3001;typeof&#x3001;+&#x3001;-&#x3001;*&#x3001;/&#x3001;%&#x3001;=&#x3001;==&#x3001;===&#x3001;&#x4E09;&#x5143;&#x3001;&#x903B;&#x8F91;&#x8FD0;&#x7B97;&#x7B26;</h3><ul>
<li>&#x6BD4;&#x8F83;&#x8FD0;&#x7B97;&#x7B26;<ul>
<li>&lt;  </li>
<li>&gt;</li>
<li><blockquote>
<p>=</p>
</blockquote>
</li>
<li>&lt;=</li>
<li>!=</li>
</ul>
</li>
<li>&#x5224;&#x65AD;&#x6570;&#x636E;&#x7C7B;&#x578B;<ul>
<li>typeof(&#x53D8;&#x91CF;&#x540D;);</li>
</ul>
</li>
<li>&#x7B97;&#x672F;&#x8FD0;&#x7B97;&#x7B26;<ul>
<li>&#x52A0;&#x8FD0;&#x7B97;&#xFF1A;<ul>
<li>&#x4E24;&#x4E2A;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x90FD;&#x4E3A;&#x6570;&#x5B57;&#x7C7B;&#x578B;&#x53D8;&#x91CF;&#x76F8;&#x52A0;&#xFF0C;&#x5F97;&#x5230;&#x7684;&#x662F;&#x6570;&#x5B57;&#x7C7B;&#x578B;&#x3002;</li>
<li>&#x4E00;&#x4E2A;&#x4E3A;&#x6570;&#x5B57;&#x7C7B;&#x578B;&#x7684;&#x53D8;&#x91CF;&#x548C;&#x4E00;&#x4E2A;&#x4E3A;&#x5B57;&#x7B26;&#x4E32;&#x7C7B;&#x578B;&#x7684;&#x53D8;&#x91CF;&#x76F8;&#x52A0;&#xFF0C;&#x5F97;&#x5230;&#x7684;&#x662F;&#x4E00;&#x4E2A;&#x5B57;&#x7B26;&#x4E32;&#x7C7B;&#x578B;&#xFF0C;&#x52A0;&#x53F7;&#x8D77;&#x4E00;&#x4E2A;&#x8FDE;&#x63A5;&#x7684;&#x4F5C;&#x7528;&#x3002;</li>
</ul>
</li>
<li>&#x51CF;&#x8FD0;&#x7B97;<ul>
<li>&#x5982;&#x679C;&#x4E24;&#x4E2A;&#x53D8;&#x91CF;&#x90FD;&#x4E3A;&#x6570;&#x5B57;&#x7C7B;&#x578B;&#x76F8;&#x51CF;&#xFF0C;&#x5F97;&#x5230;&#x7684;&#x662F;&#x6570;&#x5B57;&#x7C7B;&#x578B;&#x3002;</li>
<li>&#x5982;&#x679C;&#x4E00;&#x4E2A;&#x4E3A;&#x6570;&#x5B57;&#x7C7B;&#x578B;&#x7684;&#x53D8;&#x91CF;&#xFF0C;&#x4E00;&#x4E2A;&#x4E3A;&#x6570;&#x5B57;&#x5B57;&#x7B26;&#x4E32;&#xFF0C;&#x76F8;&#x51CF;&#x5F97;&#x5230;&#x7684;&#x662F;&#x6570;&#x5B57;&#x7C7B;&#x578B;&#x3002;</li>
<li>&#x5982;&#x679C;&#x4E00;&#x4E2A;&#x4E3A;&#x6570;&#x5B57;&#x7C7B;&#x578B;&#x7684;&#x53D8;&#x91CF;&#xFF0C;&#x4E00;&#x4E2A;&#x4E3A;&#x975E;&#x6570;&#x5B57;&#x5B57;&#x7B26;&#x4E32;&#xFF0C;&#x76F8;&#x51CF;&#x5F97;&#x5230;&#x7684;NaN,&#x6570;&#x5B57;&#x7C7B;&#x578B;&#x3002;</li>
</ul>
</li>
<li><code>*</code> &#x4E58;&#x8FD0;&#x7B97;<ul>
<li>Inifinity &#x4E0E; 0 &#x76F8;&#x4E58;&#xFF0C; undefined&#x3002;</li>
</ul>
</li>
<li>/ &#x9664;&#x8FD0;&#x7B97;<ul>
<li>&#x4E24;&#x4E2A;&#x90FD;&#x4E3A;&#x6570;&#x5B57;&#x7C7B;&#x578B;&#x7684;&#x53D8;&#x91CF;&#xFF0C;&#x76F8;&#x9664;&#x5F97;&#x5230;&#x7684;&#x662F;&#x6570;&#x5B57;&#x7C7B;&#x578B;&#x3002;</li>
<li>&#x5982;&#x679C;&#x4E00;&#x4E2A;&#x4E3A;&#x6570;&#x5B57;&#x7C7B;&#x578B;&#x7684;&#x53D8;&#x91CF;&#xFF0C;&#x4E00;&#x4E2A;&#x4E3A;&#x6570;&#x5B57;&#x5B57;&#x7B26;&#x4E32;&#x53D8;&#x91CF;&#xFF0C;&#x76F8;&#x9664;&#x5F97;&#x5230;&#x7684;&#x662F;&#x6570;&#x5B57;&#x7C7B;&#x578B;&#x3002;</li>
<li>&#x5982;&#x679C;&#x4E00;&#x4E2A;&#x4E3A;&#x6570;&#x5B57;&#x7C7B;&#x578B;&#x7684;&#x53D8;&#x91CF;&#xFF0C;&#x4E00;&#x4E2A;&#x4E3A;&#x975E;&#x6570;&#x5B57;&#x5B57;&#x7B26;&#x4E32;&#xFF0C;&#x76F8;&#x9664;&#x5F97;&#x5230;&#x7684;NaN,&#x6570;&#x5B57;&#x7C7B;&#x578B;&#x3002;</li>
<li>&#x5982;&#x679C;0&#x4F5C;&#x4E3A;&#x9664;&#x6570;&#xFF0C;&#x5F97;&#x5230;&#x7684;&#x662F;infinity(&#x65E0;&#x9650;&#x5927;)&#xFF0C;&#x662F;&#x4E00;&#x4E2A;&#x6570;&#x5B57;&#x7C7B;&#x578B;&#x3002;</li>
<li>0 / 0 &#x662F; undefined&#x3002;</li>
<li>Infinity / Infinity &#x7ED3;&#x679C;&#x662F; NaN&#x3002;</li>
</ul>
</li>
<li>% &#x53D6;&#x4F59;&#x6570;</li>
</ul>
</li>
<li>()&#x4F18;&#x5148;&#x7EA7; <ul>
<li>&#x5148;&#x8BA1;&#x7B97;()&#x62EC;&#x53F7;&#x91CC;&#x8FB9;&#x7684;&#x503C;&#x3002;</li>
</ul>
</li>
<li>&#x7B49;&#x53F7;&#x8FD0;&#x7B97;&#x7B26;<ul>
<li>&#x201C;=&#x201D;  &#x8D4B;&#x503C;&#x9884;&#x7B97;&#x7B26;</li>
<li>&#x201C;==&#x201D;  &#x6BD4;&#x8F83;&#x8FD0;&#x7B97;&#x7B26;: <strong>&#x53EA;&#x5224;&#x65AD;&#x5185;&#x5BB9;&#x662F;&#x5426;&#x76F8;&#x540C;&#xFF0C;&#x4E0D;&#x5224;&#x65AD;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x3002;</strong></li>
<li>&#x201C;===&#x201D; &#x6BD4;&#x8F83;&#x8FD0;&#x7B97;&#x7B26;: <strong>&#x4E0D;&#x4EC5;&#x5224;&#x65AD;&#x5185;&#x5BB9;&#x662F;&#x5426;&#x76F8;&#x540C;&#xFF0C;&#x8FD8;&#x5224;&#x65AD;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x662F;&#x5426;&#x76F8;&#x540C;&#x3002;</strong></li>
<li>&#x201C;!=&#x201D;  &#x4E0D;&#x7B49;&#x4E8E;: <strong>&#x53EA;&#x5224;&#x65AD;&#x5185;&#x5BB9;&#x662F;&#x5426;&#x4E0D;&#x76F8;&#x540C;&#xFF0C;&#x4E0D;&#x5224;&#x65AD;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x3002;</strong></li>
<li>&#x201C;!==&#x201D; &#x4E0D;&#x7B49;&#x4E8E;: <strong>&#x4E0D;&#x4EC5;&#x5224;&#x65AD;&#x5185;&#x5BB9;&#x662F;&#x5426;&#x4E0D;&#x76F8;&#x540C;&#xFF0C;&#x8FD8;&#x5224;&#x65AD;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x662F;&#x5426;&#x76F8;&#x540C;&#x3002;</strong></li>
</ul>
</li>
<li>&#x4E09;&#x5143;&#x8FD0;&#x7B97;&#x7B26;<ul>
<li>&#x8BED;&#x6CD5;&#xFF1A;<ul>
<li>&#x8868;&#x8FBE;&#x5F0F;&#xFF1F;&#x5982;&#x679C;&#x8868;&#x8FBE;&#x5F0F;&#x7684;&#x503C;&#x4E3A;true,&#x6267;&#x884C;&#x8868;&#x8FBE;&#x5F0F;&#x540E;&#x8FB9;&#x7684;&#x4EE3;&#x7801;&#xFF0C;&#x5982;&#x679C;&#x503C;&#x4E3A;false,&#x6267;&#x884C;&#x5192;&#x53F7;&#x540E;&#x8FB9;&#x7684;&#x503C;&#x3002;</li>
<li>&#x4E09;&#x5143;&#x8FD0;&#x7B97;&#x7B26;&#x53EF;&#x4EE5;&#x7406;&#x89E3;&#x4E3A;if..else&#x7684;&#x53E6;&#x5916;&#x4E00;&#x79CD;&#x5199;&#x6CD5;&#x3002;</li>
</ul>
</li>
</ul>
</li>
<li>&#x903B;&#x8F91;&#x8FD0;&#x7B97;&#x7B26;&#xFF1A;&#x903B;&#x8F91;&#x8FD0;&#x7B97;&#x7684;&#x524D;&#x63D0;&#x662F;&#x53C2;&#x4E0E;&#x8FD0;&#x7B97;&#x7684;&#x53D8;&#x91CF;&#x7ED3;&#x679C;&#x4E3A;Boolean&#x7C7B;&#x578B;&#x3002;<ul>
<li>&#x6216;&#xFF08;||&#xFF09;<ul>
<li>&#x53C2;&#x4E0E;&#x8FD0;&#x7B97;&#xFF0C;&#x53EA;&#x8981;&#x6EE1;&#x8DB3;&#x4E00;&#x4E2A;&#x4E3A;true,&#x6216;&#x8FD0;&#x7B97;&#x6700;&#x540E;&#x7684;&#x503C;&#x4E3A;true.</li>
<li>&#x53C2;&#x4E0E;&#x8FD0;&#x7B97;&#x7684;&#x503C;&#x90FD;&#x4E3A;false,&#x6216;&#x8FD0;&#x7B97;&#x6700;&#x540E;&#x7684;&#x503C;&#x4E3A;false.</li>
</ul>
</li>
<li>&#x4E14;&#xFF08;&amp;&amp;&#xFF09;<ul>
<li>&#x53C2;&#x4E0E;&#x8FD0;&#x7B97;&#xFF0C;&#x53EA;&#x8981;&#x6EE1;&#x8DB3;&#x4E00;&#x4E2A;&#x4E3A;false,&#x6216;&#x8FD0;&#x7B97;&#x6700;&#x540E;&#x7684;&#x503C;&#x4E3A;false.</li>
<li>&#x53C2;&#x4E0E;&#x8FD0;&#x7B97;&#xFF0C;&#x90FD;&#x4E3A;true&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x4E14;&#x8FD0;&#x7B97;&#x6700;&#x540E;&#x7684;&#x503C;&#x4E3A;true.</li>
</ul>
</li>
<li>&#x975E;&#xFF08;!&#xFF09;<ul>
<li>&#x5982;&#x679C;&#x8FD0;&#x7B97;&#x7ED3;&#x679C;&#x4E3A;true,&#x975E;&#x8FD0;&#x7B97;&#x7ED3;&#x679C;&#x4E3A;false</li>
<li>&#x5982;&#x679C;&#x8FD0;&#x7B97;&#x7ED3;&#x679C;&#x4E3A;false,&#x975E;&#x8FD0;&#x7B97;&#x7ED3;&#x679C;&#x4E3A;true.</li>
</ul>
</li>
</ul>
</li>
</ul>
<h4 id="&#x975E;"><a href="#&#x975E;" class="headerlink" title="&#x975E;"></a>&#x975E;</h4><ul>
<li>&#x5982;&#x679C;&#x64CD;&#x4F5C;&#x6570;&#x662F;&#x4E00;&#x4E2A;&#x5BF9;&#x8C61;&#xFF0C;&#x8FD4;&#x56DE; false</li>
<li>&#x5982;&#x679C;&#x64CD;&#x4F5C;&#x6570;&#x662F;&#x4E00;&#x4E2A;&#x7A7A;&#x5B57;&#x7B26;&#x4E32;&#xFF0C;&#x8FD4;&#x56DE; true</li>
<li>&#x5982;&#x679C;&#x64CD;&#x4F5C;&#x6570;&#x662F;&#x4E00;&#x4E2A;&#x975E;&#x7A7A;&#x5B57;&#x7B26;&#x4E32;&#xFF0C;&#x8FD4;&#x56DE; false</li>
<li>&#x5982;&#x679C;&#x64CD;&#x4F5C;&#x6570;&#x662F;&#x6570;&#x503C; 0 &#xFF0C;&#x8FD4;&#x56DE; true</li>
<li>&#x5982;&#x679C;&#x64CD;&#x4F5C;&#x6570;&#x662F;&#x4EFB;&#x610F;&#x975E; 0 &#x6570;&#x503C;&#xFF0C;&#x5305;&#x62EC; Infinity &#xFF0C;&#x8FD4;&#x56DE; true</li>
<li>&#x5982;&#x679C;&#x64CD;&#x4F5C;&#x6570;&#x662F; null &#xFF0C;&#x8FD4;&#x56DE; true</li>
<li>&#x5982;&#x679C;&#x64CD;&#x4F5C;&#x6570;&#x662F; NaN &#xFF0C;&#x8FD4;&#x56DE; true</li>
<li>&#x5982;&#x679C;&#x64CD;&#x4F5C;&#x6570;&#x662F; undefined &#xFF0C;&#x8FD4;&#x56DE; true</li>
</ul>
<h4 id="&#x4E0E;"><a href="#&#x4E0E;" class="headerlink" title="&#x4E0E;"></a>&#x4E0E;</h4><ul>
<li>&#x5982;&#x679C;&#x7B2C;&#x4E00;&#x4E2A;&#x64CD;&#x4F5C;&#x6570;&#x662F;&#x5BF9;&#x8C61;&#xFF0C;&#x8FD4;&#x56DE;&#x7B2C;&#x4E8C;&#x4E2A;&#x64CD;&#x4F5C;&#x6570;&#xFF1B;</li>
<li>&#x5982;&#x679C;&#x7B2C;&#x4E8C;&#x4E2A;&#x64CD;&#x4F5C;&#x6570;&#x662F;&#x5BF9;&#x8C61;&#xFF0C;&#x53EA;&#x6709;&#x7B2C;&#x4E8C;&#x4E2A;&#x6570;&#x6C42;&#x503C;&#x7ED3;&#x679C;&#x4E3A; true &#x662F;&#xFF0C;&#x8FD4;&#x56DE;&#x8BE5;&#x5BF9;&#x8C61;</li>
<li>&#x5982;&#x679C;&#x4E24;&#x4E2A;&#x90FD;&#x662F;&#x5BF9;&#x8C61;&#xFF0C;&#x8FD4;&#x56DE;&#x7B2C;&#x4E8C;&#x4E2A;&#xFF1B;</li>
<li>&#x5982;&#x679C;&#x6709;&#x4E00;&#x4E2A;&#x64CD;&#x4F5C;&#x6570;&#x662F; null &#xFF0C;&#x8FD4;&#x56DE; null</li>
<li>&#x5982;&#x679C;&#x6709;&#x4E00;&#x4E2A;&#x64CD;&#x4F5C;&#x6570;&#x662F; NaN &#xFF0C;&#x8FD4;&#x56DE; NaN</li>
<li>&#x5982;&#x679C;&#x6709;&#x4E00;&#x4E2A;&#x64CD;&#x4F5C;&#x6570;&#x662F; undefined &#xFF0C;&#x8FD4;&#x56DE; undefined</li>
</ul>
<h4 id="&#x6216;"><a href="#&#x6216;" class="headerlink" title="&#x6216;"></a>&#x6216;</h4><ul>
<li>&#x5982;&#x679C;&#x7B2C;&#x4E00;&#x4E2A;&#x64CD;&#x4F5C;&#x6570;&#x662F;&#x5BF9;&#x8C61;&#xFF0C;&#x8FD4;&#x56DE;&#x7B2C;&#x4E00;&#x4E2A;&#xFF1B;</li>
<li>&#x5982;&#x679C;&#x7B2C;&#x4E00;&#x4E2A;&#x64CD;&#x4F5C;&#x6570;&#x6C42;&#x503C;&#x7ED3;&#x679C; false &#xFF0C;&#x8FD4;&#x56DE;&#x7B2C;&#x4E8C;&#x4E2A;</li>
<li>&#x5982;&#x679C;&#x4E24;&#x4E2A;&#x90FD;&#x662F;&#x5BF9;&#x8C61;&#xFF0C;&#x8FD4;&#x56DE;&#x7B2C;&#x4E00;&#x4E2A;&#xFF1B;</li>
<li>&#x5982;&#x679C;&#x4E24;&#x4E2A;&#x64CD;&#x4F5C;&#x6570;&#x662F; null &#xFF0C;&#x8FD4;&#x56DE; null</li>
<li>&#x5982;&#x679C;&#x4E24;&#x4E2A;&#x64CD;&#x4F5C;&#x6570;&#x662F; NaN &#xFF0C;&#x8FD4;&#x56DE; NaN</li>
<li>&#x5982;&#x679C;&#x4E24;&#x4E2A;&#x64CD;&#x4F5C;&#x6570;&#x662F; undefined &#xFF0C;&#x8FD4;&#x56DE; undefined</li>
</ul>
<p>&#x603B;&#x7ED3;&#x903B;&#x8F91;&#x8FD0;&#x7B97;&#x7B26;&#xFF1A;</p>
<ol>
<li>&amp;&amp;&#x548C;||&#x90FD;&#x91C7;&#x53D6;&#x77ED;&#x8DEF;&#x8FD0;&#x7B97;&#xFF0C;&#x5373;&#x7B2C;&#x4E00;&#x4E2A;&#x80FD;&#x591F;&#x51B3;&#x5B9A;&#x7ED3;&#x679C;&#x5C31;&#x4E0D;&#x518D;&#x770B;&#x7B2C;&#x4E8C;&#x4E2A;&#x4E86;</li>
<li>&amp;&amp; &#x7684;&#x8981;&#x6C42;&#x6BD4;&#x8F83;&#x5BBD;&#x677E; &#x8981;&#x4E24;&#x4E2A;&#x90FD;&#x662F;true&#x624D;&#x662F;true &#x6240;&#x4EE5;&#x770B;&#x5230;&#x7B2C;&#x4E00;&#x4E2A;&#x662F;false&#x5C31;&#x6CA1;&#x6709;&#x5FC5;&#x8981;&#x7EE7;&#x7EED;&#x5B8C;&#x540E;&#x770B;&#x4E86;</li>
<li>|| &#x7684;&#x8981;&#x6C42;&#x6BD4;&#x8F83;&#x4E25;&#x683C;&#xFF0C;&#x8981;&#x4E24;&#x4E2A;&#x90FD;&#x662F;false&#x624D;&#x662F;false&#xFF0C;&#x6240;&#x4EE5;&#x770B;&#x5230;&#x7B2C;&#x4E00;&#x4E2A;&#x662F;true&#x5C31;&#x6CA1;&#x6709;&#x5FC5;&#x8981;&#x7EE7;&#x7EED;&#x5B8C;&#x540E;&#x770B;&#x4E86;</li>
<li>&amp;&amp;&#x548C;||&#x4E0D;&#x4F46;&#x53EF;&#x4EE5;&#x64CD;&#x4F5C;&#x5E03;&#x5C14;&#x7C7B;&#x578B;&#x7684;&#x503C;&#xFF0C;&#x5BF9;&#x5176;&#x4ED6;&#x7C7B;&#x578B;&#x7684;&#x503C;&#x4E5F;&#x53EF;&#x4EE5;&#x8FDB;&#x884C;&#x64CD;&#x4F5C;&#xFF0C;&#x5E76;&#x8FD4;&#x56DE;&#x53EF;&#x4EE5;&#x51B3;&#x5B9A;&#x8868;&#x8FBE;&#x5F0F;&#x7ED3;&#x679C;&#x7684;&#x90A3;&#x4E2A;&#x503C;&#x3002;</li>
</ol>
<h2 id="&#x81EA;&#x589E;&#x81EA;&#x51CF;"><a href="#&#x81EA;&#x589E;&#x81EA;&#x51CF;" class="headerlink" title="&#x81EA;&#x589E;&#x81EA;&#x51CF;"></a>&#x81EA;&#x589E;&#x81EA;&#x51CF;</h2><ul>
<li>++i&#xFF0C;i++<ul>
<li>&#x5728;&#x6CA1;&#x6709;&#x53C2;&#x52A0;&#x8FD0;&#x7B97;&#x7684;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;++i   i++&#x90FD;&#x662F;&#x5728;&#x53D8;&#x91CF;&#x7684;&#x57FA;&#x7840;&#x4E0A;&#x52A0;1&#x3002;</li>
<li>&#x5728;&#x53C2;&#x52A0;&#x8FD0;&#x7B97;&#x7684;&#x60C5;&#x51B5;&#x4E0B;&#xFF1A;</li>
</ul>
</li>
</ul>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">var</span> n1=<span class="number">123</span>;</div><div class="line"><span class="keyword">var</span> n2=n1++;  <span class="comment">// &#x5148;&#x628A;n1&#x7684;&#x503C;&#x8D4B;&#x7ED9;n2,&#x7136;&#x540E;n1&#x6267;&#x884C;&#x52A0;1&#x7684;&#x64CD;&#x4F5C;&#x3002;</span></div><div class="line">Var n2=++n1;  <span class="comment">// &#x5148;&#x6267;&#x884C;n1&#x52A0;1&#x7684;&#x64CD;&#x4F5C;&#xFF0C;&#x518D;&#x8D4B;&#x503C;&#x7ED9;n2.</span></div></pre></td></tr></table></figure>
<p>&#x603B;&#x7684;&#x6765;&#x8BF4;&#xFF1A;</p>
<ul>
<li>&#x9012;&#x589E;++ &#x9012;&#x51CF;&#x2013;</li>
<li>a++ &#x5148;&#x53C2;&#x4E0E;&#x8FD0;&#x7B97; &#x540E;&#x81EA;&#x52A0;</li>
<li>++a &#x5148;&#x81EA;&#x52A0; &#x540E;&#x53C2;&#x4E0E;&#x8FD0;&#x7B97;</li>
</ul>
<p>&#x6CE8;&#x610F;&#xFF1A;</p>
<ul>
<li>&#x5728;&#x5E94;&#x7528;&#x4E8E;&#x4E00;&#x4E2A;&#x5305;&#x542B;&#x6709;&#x6548;&#x6570;&#x5B57;&#x5B57;&#x7B26;&#x4E32;&#x662F;&#xFF0C;&#x5148;&#x5C06;&#x5176;&#x8F6C;&#x6362;&#x4E3A;&#x6570;&#x5B57;&#x503C;&#x518D;&#x6267;&#x884C;&#x52A0;&#x51CF;1&#x7684;&#x64CD;&#x4F5C;&#x3002;</li>
<li>&#x5728;&#x5E94;&#x7528;&#x4E8E;&#x4E00;&#x4E2A;&#x4E0D;&#x5305;&#x542B;&#x6709;&#x6548;&#x6570;&#x5B57;&#x5B57;&#x7B26;&#x7684;&#x5B57;&#x7B26;&#x4E32;&#x65F6;&#xFF0C;&#x5C06;&#x53D8;&#x91CF;&#x7684;&#x503C;&#x8BBE;&#x7F6E;&#x4E3A; NaN&#x3002;</li>
<li>&#x5728;&#x5E94;&#x7528;&#x4E8E;&#x5E03;&#x5C14;&#x503C; false &#x65F6;&#xFF0C;&#x5148;&#x5C06;&#x5176;&#x8F6C;&#x6362;&#x4E3A; 0 &#x518D;&#x6267;&#x884C;&#x52A0;&#x51CF; 1 &#x7684;&#x64CD;&#x4F5C;&#x3002;</li>
<li>&#x5728;&#x5E94;&#x7528;&#x4E8E;&#x5E03;&#x5C14;&#x503C; true &#x65F6;&#xFF0C;&#x5148;&#x5C06;&#x5176;&#x8F6C;&#x6362;&#x4E3A; 1 &#x518D;&#x6267;&#x884C;&#x52A0;&#x51CF; 1 &#x7684;&#x64CD;&#x4F5C;&#x3002;</li>
<li>&#x5728;&#x5E94;&#x7528;&#x4E8E;&#x5BF9;&#x8C61;&#x65F6;&#xFF0C;&#x5148;&#x62B5;&#x7528;&#x5BF9;&#x8C61;&#x7684; valueOf &#x65B9;&#x6CD5;&#x4EE5;&#x53D6;&#x5F97;&#x4E00;&#x4E2A;&#x53EF;&#x4F9B;&#x64CD;&#x4F5C;&#x7684;&#x503C;&#xFF0C;&#x7136;&#x540E;&#x5BF9;&#x8BE5;&#x503C;&#x5E94;&#x7528;&#x524D;&#x9762;&#x7684;&#x89C4;&#x5219;&#x3002;&#x5982;&#x679C;&#x7ED3;&#x679C;&#x662F;NaN&#xFF0C;&#x5219;&#x8C03;&#x7528; toString() &#x65B9;&#x6CD5;&#x540E;&#x518D;&#x5E94;&#x7528;&#x524D;&#x8FF0;&#x7684;&#x89C4;&#x5219;&#x3002;</li>
</ul>
<h3 id="&#x5E26;&#x64CD;&#x4F5C;&#x7684;&#x8D4B;&#x503C;&#x8FD0;&#x7B97;&#x7B26;"><a href="#&#x5E26;&#x64CD;&#x4F5C;&#x7684;&#x8D4B;&#x503C;&#x8FD0;&#x7B97;&#x7B26;" class="headerlink" title="&#x5E26;&#x64CD;&#x4F5C;&#x7684;&#x8D4B;&#x503C;&#x8FD0;&#x7B97;&#x7B26;"></a>&#x5E26;&#x64CD;&#x4F5C;&#x7684;&#x8D4B;&#x503C;&#x8FD0;&#x7B97;&#x7B26;</h3><p><img src="/2014/03/28/js-&#x8868;&#x8FBE;&#x5F0F;&#x548C;&#x8FD0;&#x7B97;&#x7B26;/6.3.png" alt="&#x5E26;&#x64CD;&#x4F5C;&#x7684;&#x8D4B;&#x503C;&#x8FD0;&#x7B97;&#x7B26;"></p>
<h2 id="&#x4F4D;&#x64CD;&#x4F5C;&#x7B26;"><a href="#&#x4F4D;&#x64CD;&#x4F5C;&#x7B26;" class="headerlink" title="&#x4F4D;&#x64CD;&#x4F5C;&#x7B26;"></a>&#x4F4D;&#x64CD;&#x4F5C;&#x7B26;</h2><p>0 &#x6B63; 1 &#x8D1F;&#xFF0C;&#x6700;&#x9AD8;&#x4F4D;&#x8868;&#x793A;&#x7B26;&#x53F7;&#x4F4D;&#x3002;&#x6B63;&#x6570;&#x548C;&#x8D1F;&#x6570;&#x90FD;&#x662F;&#x4EE5;&#x4E8C;&#x8FDB;&#x5236;&#x7801;&#x6765;&#x5B58;&#x50A8;&#xFF0C;&#x4F46;&#x8D1F;&#x6570;&#x4F7F;&#x7528;&#x7684;&#x683C;&#x5F0F;&#x662F;&#x4E8C;&#x8FDB;&#x5236;&#x8865;&#x7801;&#x3002;&#x8BA1;&#x7B97;&#x8FC7;&#x7A0B;&#x5982;&#x4E0B;&#xFF1A;</p>
<ul>
<li>&#x6C42;&#x8FD9;&#x4E2A;&#x6570;&#x7EDD;&#x5BF9;&#x503C;&#x7684;&#x4E8C;&#x8FDB;&#x5236;&#x7801;&#xFF1B;</li>
<li>&#x6C42;&#x4E8C;&#x8FDB;&#x5236;&#x53CD;&#x7801;&#xFF1B;</li>
<li>&#x5F97;&#x5230;&#x7684;&#x53CD;&#x7801;&#x52A0; 1&#x3002;</li>
</ul>
<p>ECMAScript &#x4E2D;&#xFF0C;&#x5BF9; NaN, Infinity &#x503C;&#x5E94;&#x7528;&#x4F4D;&#x64CD;&#x4F5C;&#x65F6;&#xFF0C;&#x8FD9;&#x4E24;&#x4E2A;&#x503C;&#x90FD;&#x5F53;&#x505A; 0 &#x6765;&#x5904;&#x7406;&#x3002;</p>
<ul>
<li>&#x6309;&#x4F4D;&#x975E;(~)</li>
<li>&#x6309;&#x4F4D;&#x4E0E;(&amp;)</li>
<li>&#x6309;&#x4F4D;&#x6216;(|)</li>
<li>&#x6309;&#x4F4D;&#x5F02;&#x6216;(^)</li>
<li>&#x5DE6;&#x79FB;(&lt;&lt;)</li>
<li>&#x6709;&#x7B26;&#x53F7;&#x53F3;&#x79FB;(&gt;&gt;)</li>
<li>&#x65E0;&#x7B26;&#x53F7;&#x53F3;&#x79FB;(&gt;&gt;&gt;)</li>
</ul>
<h2 id="instanceof-&#x64CD;&#x4F5C;&#x7B26;"><a href="#instanceof-&#x64CD;&#x4F5C;&#x7B26;" class="headerlink" title="instanceof &#x64CD;&#x4F5C;&#x7B26;"></a>instanceof &#x64CD;&#x4F5C;&#x7B26;</h2><p>&#x6D4B;&#x8BD5;&#x5BF9;&#x8C61;&#x7C7B;&#xFF0C;&#x5DE6;&#x64CD;&#x4F5C;&#x6570;&#x662F;&#x4E00;&#x4E2A;&#x5BF9;&#x8C61;&#xFF0C;&#x53F3;&#x64CD;&#x4F5C;&#x6570;&#x662F;&#x6807;&#x8BC6;&#x5BF9;&#x8C61;&#x7684;&#x7C7B;&#x3002;&#x5982;&#x679C;&#x5DE6;&#x4FA7;&#x7684;&#x5BF9;&#x8C61;&#x662F;&#x53F3;&#x4FA7;&#x7C7B;&#x7684;&#x5B9E;&#x4F8B;&#xFF0C;<br>&#x5219;&#x8868;&#x8FBE;&#x5F0F;&#x8FD4;&#x56DE;true&#xFF0C;&#x5426;&#x5219;&#x8FD4;&#x56DE;false&#x3002;</p>
<h2 id="in-&#x64CD;&#x4F5C;&#x7B26;"><a href="#in-&#x64CD;&#x4F5C;&#x7B26;" class="headerlink" title="in &#x64CD;&#x4F5C;&#x7B26;"></a>in &#x64CD;&#x4F5C;&#x7B26;</h2><p>&#x5224;&#x65AD;&#x5C5E;&#x6027;&#x662F;&#x5426;&#x5B58;&#x5728;, in &#x8FD0;&#x7B97;&#x7B26;&#x5E0C;&#x671B;&#x5B83;&#x7684;&#x5DE6;&#x64CD;&#x4F5C;&#x6570;&#x662F;&#x4E00;&#x4E2A;&#x5B57;&#x7B26;&#x4E32;&#x6216;&#x53EF;&#x4EE5;&#x8F6C;&#x6362;&#x4E3A;&#x5B57;&#x7B26;&#x4E32;&#xFF0C;<br>&#x5E0C;&#x671B;&#x5B83;&#x7684;&#x53F3;&#x64CD;&#x4F5C;&#x6570;&#x662F;&#x4E00;&#x4E2A;&#x5BF9;&#x8C61;&#xFF0C;&#x5982;&#x679C;&#x53F3;&#x4FA7;&#x7684;&#x5BF9;&#x8C61;&#x62E5;&#x6709;&#x4E00;&#x4E2A;&#x540D;&#x4E3A;&#x5DE6;&#x4FA7;&#x64CD;&#x4F5C;&#x6570;&#x503C;&#x7684;&#x5C5E;&#x6027;&#x540D;&#xFF0C;<br>&#x90A3;&#x4E48;&#x8868;&#x8FBE;&#x5F0F;&#x8FD4;&#x56DE;true&#x3002;</p>
<h2 id="&#x64CD;&#x4F5C;&#x7B26;&#x4F18;&#x5148;&#x7EA7;"><a href="#&#x64CD;&#x4F5C;&#x7B26;&#x4F18;&#x5148;&#x7EA7;" class="headerlink" title="&#x64CD;&#x4F5C;&#x7B26;&#x4F18;&#x5148;&#x7EA7;"></a>&#x64CD;&#x4F5C;&#x7B26;&#x4F18;&#x5148;&#x7EA7;</h2><p><img src="/2014/03/28/js-&#x8868;&#x8FBE;&#x5F0F;&#x548C;&#x8FD0;&#x7B97;&#x7B26;/s09.1.jpg" alt="&#x64CD;&#x4F5C;&#x7B26;&#x4F18;&#x5148;&#x7EA7;"></p>
<h2 id="eval"><a href="#eval" class="headerlink" title="eval()"></a>eval()</h2><p>eval() &#x662F;&#x4E00;&#x4E2A;&#x51FD;&#x6570;&#xFF0C;&#x4F46;&#x5B83;&#x5DF2;&#x7ECF;&#x88AB;&#x5F53;&#x505A;&#x8FD0;&#x7B97;&#x7B26;&#x6765;&#x5BF9;&#x5F85;&#x4E86;&#x3002;</p>
<h3 id="eval-1"><a href="#eval-1" class="headerlink" title="eval()"></a>eval()</h3><p>eval() &#x53EA;&#x6709;&#x4E00;&#x4E2A;&#x53C2;&#x6570;&#x3002;&#x5982;&#x679C;&#x4F20;&#x5165;&#x7684;&#x4E0D;&#x662F;&#x5B57;&#x7B26;&#x4E32;&#xFF0C;&#x76F4;&#x63A5;&#x8FD4;&#x56DE;&#x8FD9;&#x4E2A;&#x53C2;&#x6570;&#xFF0C;&#x5982;&#x679C;&#x662F;&#x5B57;&#x7B26;&#x4E32;&#xFF0C;<br>&#x4F1A;&#x628A;&#x5B57;&#x7B26;&#x4E32;&#x5F53;&#x6210; JavaScript &#x4EE3;&#x7801;&#x8FDB;&#x884C;&#x7F16;&#x8BD1;&#xFF0C;&#x5982;&#x679C;&#x4FBF;&#x4EE5;&#x5931;&#x8D25;&#x629B;&#x51FA;&#x5F02;&#x5E38;&#xFF0C;&#x7F16;&#x8BD1;&#x6210;&#x529F;&#x5219;&#x6267;&#x884C;&#x8FD9;&#x6BB5;&#x4EE3;&#x7801;&#x3002;<br>&#x8FD4;&#x56DE;&#x5B57;&#x7B26;&#x4E32;&#x4E2D;&#x6700;&#x540E;&#x4E00;&#x4E2A;&#x8868;&#x8FBE;&#x5F0F;&#x6216;&#x8BED;&#x53E5;&#x7684;&#x503C;&#xFF0C;&#x5982;&#x679C;&#x6700;&#x540E;&#x4E00;&#x4E2A;&#x8868;&#x8FBE;&#x5F0F;&#x4E2D;&#x6CA1;&#x6709;&#x8FD4;&#x56DE;&#x503C;&#xFF0C;&#x5219;&#x8FD4;&#x56DE; undefined&#x3002;</p>
<p>eval() &#x5B83;&#x4F7F;&#x7528;&#x4E86;&#x8C03;&#x7528;&#x5B83;&#x7684;&#x53D8;&#x91CF;&#x4F5C;&#x7528;&#x57DF;&#x73AF;&#x5883;&#x3002;&#x5B83;&#x67E5;&#x627E;&#x53D8;&#x91CF;&#x7684;&#x503C;&#x548C;&#x5B9A;&#x4E49;&#x65B0;&#x53D8;&#x91CF;&#x548C;&#x51FD;&#x6570;&#x7684;&#x64CD;&#x4F5C;&#x548C;&#x5C40;&#x90E8;&#x4F5C;&#x7528;&#x57DF;&#x4E2D;&#x7684;&#x4EE3;&#x7801;&#x5B8C;&#x5168;&#x4E00;&#x6837;&#x3002;</p>
<h3 id="&#x5168;&#x5C40;&#x7684;-eval"><a href="#&#x5168;&#x5C40;&#x7684;-eval" class="headerlink" title="&#x5168;&#x5C40;&#x7684; eval()"></a>&#x5168;&#x5C40;&#x7684; eval()</h3><p>eval() &#x5177;&#x6709;&#x6539;&#x53D8;&#x5C40;&#x90E8;&#x53D8;&#x91CF;&#x7684;&#x80FD;&#x529B;&#x3002;&#x5F53;&#x76F4;&#x63A5;&#x4F7F;&#x7528; &#x201C;eval&#x201D; &#x540D;&#x79F0;&#x6765;&#x8C03;&#x7528; eval() &#x51FD;&#x6570;&#x65F6;&#xFF0C;&#x901A;&#x5E38;&#x79F0;&#x4E3A;&#x201D;&#x76F4;&#x63A5; eval&#x201D;.<br>&#x76F4;&#x63A5;&#x8C03;&#x7528; eval() &#x65F6;&#xFF0C;&#x5B83;&#x603B;&#x662F;&#x8C03;&#x7528;&#x5B83;&#x7684;&#x4E0A;&#x4E0B;&#x6587;&#x4F5C;&#x7528;&#x57DF;&#x5185;&#x6267;&#x884C;&#x3002;&#x5176;&#x5B83;&#x95F4;&#x63A5;&#x8C03;&#x7528;&#x4F7F;&#x7528;&#x5168;&#x5C40;&#x5BF9;&#x8C61;&#x4F5C;&#x4E3A;&#x5176;&#x4E0A;&#x4E0B;&#x6587;&#x4F5C;&#x7528;&#x57DF;&#xFF0C;<br>&#x5E76;&#x4E14;&#x65E0;&#x6CD5;&#x8BFB;&#x3001;&#x5199;&#x3001;&#x5B9A;&#x4E49;&#x5C40;&#x90E8;&#x53D8;&#x91CF;&#x548C;&#x51FD;&#x6570;&#x3002;</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">var</span> geval = <span class="built_in">eval</span>;</div><div class="line"><span class="keyword">var</span> x = <span class="string">&quot;global&quot;</span>, y = <span class="string">&quot;global&quot;</span>;</div><div class="line"><span class="function"><span class="keyword">function</span> <span class="title">f</span>(<span class="params"></span>)</span>{</div><div class="line">  <span class="keyword">var</span> x = <span class="string">&quot;local&quot;</span>;</div><div class="line">  <span class="built_in">eval</span> (<span class="string">&quot;x += &apos;changed&apos;&quot;</span>);</div><div class="line">  <span class="keyword">return</span> x;</div><div class="line">}</div><div class="line"><span class="function"><span class="keyword">function</span> <span class="title">g</span>(<span class="params"></span>)</span>{</div><div class="line">  <span class="keyword">var</span> y = <span class="string">&quot;local&quot;</span>;</div><div class="line">  geval (<span class="string">&quot;y += &apos;changed&apos;&quot;</span>);</div><div class="line">  <span class="keyword">return</span> y;</div><div class="line">}</div><div class="line"><span class="built_in">console</span>.log(f(),x);</div><div class="line"><span class="built_in">console</span>.log(g(),y);</div></pre></td></tr></table></figure>
<h3 id="&#x4E25;&#x683C;&#x7684;-eval"><a href="#&#x4E25;&#x683C;&#x7684;-eval" class="headerlink" title="&#x4E25;&#x683C;&#x7684; eval()"></a>&#x4E25;&#x683C;&#x7684; eval()</h3><p>ECMAScript 5 &#x4E25;&#x683C;&#x6A21;&#x5F0F;&#x4E2D;&#xFF0C;eval() &#x662F;&#x79C1;&#x6709;&#x4E0A;&#x4E0B;&#x6587;&#x73AF;&#x5883;&#x4E2D;&#x7684;&#x5C40;&#x90E8; eval()&#xFF0C;<br>eval() &#x6267;&#x884C;&#x7684;&#x4EE3;&#x7801;&#x6BB5;&#x53EF;&#x4EE5;&#x67E5;&#x8BE2;&#x6216;&#x66F4;&#x6539;&#x5C40;&#x90E8;&#x53D8;&#x91CF;&#xFF0C;&#x4F46;&#x4E0D;&#x80FD;&#x5728;&#x5C40;&#x90E8;&#x4F5C;&#x7528;&#x57DF;&#x4E2D;&#x5B9A;&#x4E49;&#x65B0;&#x53D8;&#x91CF;&#x3002;</p>
<h2 id="delete-&#x8FD0;&#x7B97;&#x7B26;"><a href="#delete-&#x8FD0;&#x7B97;&#x7B26;" class="headerlink" title="delete &#x8FD0;&#x7B97;&#x7B26;"></a>delete &#x8FD0;&#x7B97;&#x7B26;</h2><p>delete &#x8FD0;&#x7B97;&#x7B26;&#x65F6;&#x4E00;&#x5143;&#x8FD0;&#x7B97;&#x7B26;&#xFF0C;&#x7528;&#x6765;&#x5220;&#x9664;&#x5BF9;&#x8C61;&#x5C5E;&#x6027;&#x6216;&#x8005;&#x6570;&#x7EC4;&#x5143;&#x7D20;&#x3002;<br>&#x5220;&#x9664;&#x5C5E;&#x6027;&#x6216;&#x8005;&#x5220;&#x9664;&#x6570;&#x7EC4;&#x5143;&#x7D20;&#x4E0D;&#x4EC5;&#x4EC5;&#x662F;&#x8BBE;&#x7F6E;&#x4E86;&#x4E00;&#x4E2A; undefined &#x7684;&#x503C;&#x3002;<br>&#x5F53;&#x5220;&#x9664;&#x4E00;&#x4E2A;&#x5C5E;&#x6027;&#x65F6;&#xFF0C;&#x8FD9;&#x4E2A;&#x5C5E;&#x6027;&#x5C06;&#x4E0D;&#x518D;&#x5B58;&#x5728;&#x3002;<br>&#x8BFB;&#x53D6;&#x4E00;&#x4E2A;&#x4E0D;&#x5B58;&#x5728;&#x7684;&#x5C5E;&#x6027;&#x5C06;&#x8FD4;&#x56DE; undefined&#xFF0C;&#x4F46;&#x662F;&#x53EF;&#x4EE5;&#x901A;&#x8FC7; in &#x8FD0;&#x7B97;&#x7B26;&#x6765;&#x68C0;&#x6D4B;&#x8FD9;&#x4E2A;&#x5C5E;&#x6027;&#x662F;&#x5426;&#x5728;&#x5BF9;&#x8C61;&#x4E2D;&#x5B58;&#x5728;&#x3002;</p>
<h2 id="void-&#x8FD0;&#x7B97;&#x7B26;"><a href="#void-&#x8FD0;&#x7B97;&#x7B26;" class="headerlink" title="void &#x8FD0;&#x7B97;&#x7B26;"></a>void &#x8FD0;&#x7B97;&#x7B26;</h2><p>void &#x8FD0;&#x7B97;&#x7B26;&#x662F;&#x4E00;&#x5143;&#x8FD0;&#x7B97;&#x7B26;&#xFF0C;&#x5728;&#x64CD;&#x4F5C;&#x6570;&#x4E4B;&#x524D;&#xFF0C;&#x64CD;&#x4F5C;&#x6570;&#x53EF;&#x4EE5;&#x4F7F;&#x4EFB;&#x610F;&#x7C7B;&#x578B;&#x3002;<br>&#x901A;&#x5E38;&#x7528;&#x5728;&#x5BA2;&#x6237;&#x7AEF;&#x7684;URL&#x2013;javascript: URL &#x4E2D;&#xFF0C;&#x5728; URL &#x4E2D;&#x53EF;&#x4EE5;&#x5199;&#x5E26;&#x6709;&#x526F;&#x4F5C;&#x7528;&#x7684;&#x8868;&#x8FBE;&#x5F0F;&#xFF0C;<br>&#x800C; void &#x5219;&#x8BA9;&#x6D4F;&#x89C8;&#x5668;&#x4E0D;&#x6BD4;&#x663E;&#x793A;&#x8FD9;&#x4E2A;&#x8868;&#x8FBE;&#x5F0F;&#x7684;&#x8BA1;&#x7B97;&#x7ED3;&#x679C;&#x3002;</p>
<p>&#x4F8B;&#x5982;&#xFF1A;</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">&quot;javascript:void window.open();&quot;</span>&gt;</span>&#x6253;&#x5F00;&#x4E00;&#x4E2A;&#x65B0;&#x7A97;&#x53E3;<span class="tag">&lt;/<span class="name">a</span>&gt;</span></div></pre></td></tr></table></figure>
<p>&#x901A;&#x8FC7;&#x7ED9; <code>&lt;a&gt;</code> &#x6807;&#x7B7E;&#x7684;onclick &#x7ED1;&#x5B9A;&#x4E00;&#x4E2A;&#x4E8B;&#x4EF6;&#x5904;&#x7406;&#x7A0B;&#x5E8F;&#x8981;&#x6BD4;&#x5728; href &#x4E2D;&#x5199; &#x201C;javascript:URL&#x201D; &#x8981;&#x66F4;&#x52A0;&#x6E05;&#x6670;&#xFF0C;<br>&#x8FD9;&#x79CD;&#x60C5;&#x51B5;&#x4E0B; void &#x53EF;&#x6709;&#x53EF;&#x65E0;&#x3002;</p>
<h2 id="&#x9017;&#x53F7;&#x8FD0;&#x7B97;&#x7B26;"><a href="#&#x9017;&#x53F7;&#x8FD0;&#x7B97;&#x7B26;" class="headerlink" title="&#x9017;&#x53F7;&#x8FD0;&#x7B97;&#x7B26;"></a>&#x9017;&#x53F7;&#x8FD0;&#x7B97;&#x7B26;</h2><p>&#x9017;&#x53F7;&#x8FD0;&#x7B97;&#x7B26;&#x662F;&#x4E8C;&#x5143;&#x64CD;&#x4F5C;&#x7B26;&#xFF0C;&#x64CD;&#x4F5C;&#x6570;&#x53EF;&#x4EE5;&#x662F;&#x4EFB;&#x610F;&#x7C7B;&#x578B;&#xFF0C;&#x5148;&#x8BA1;&#x7B97;&#x5DE6;&#x8FB9;&#x64CD;&#x4F5C;&#x6570;&#x540E;&#x8BA1;&#x7B97;&#x53F3;&#x8FB9;&#x64CD;&#x4F5C;&#x6570;&#xFF0C;<br>&#x6700;&#x540E;&#x8FD4;&#x56DE;&#x53F3;&#x64CD;&#x4F5C;&#x6570;&#x7684;&#x503C;&#x3002;</p>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        
  <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
    <div>坚持原创技术分享，您的支持将是我最大的鼓励！</div>
    <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
      <span>赏</span>
    </button>
    <div id="QR" style="display: none;">
      
        <div id="wechat" style="display: inline-block">
          <img id="wechat_qr" src="http://ofy7k3v4s.bkt.clouddn.com/wcpayCode.jpg" alt="Hongqin Ma WeChat Pay"/>
          <p>微信打赏</p>
        </div>
      
      
        <div id="alipay" style="display: inline-block">
          <img id="alipay_qr" src="http://ofy7k3v4s.bkt.clouddn.com/apayCode.jpg" alt="Hongqin Ma Alipay"/>
          <p>支付宝打赏</p>
        </div>
      
    </div>
  </div>


      
    </div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/js/" rel="tag">#js</a>
          
        </div>
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2014/03/18/js-变量和数据类型/" rel="next" title="js 变量和数据类型">
                <i class="fa fa-chevron-left"></i> js 变量和数据类型
              </a>
            
          </div>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2014/04/06/js语句/" rel="prev" title="js语句">
                js语句 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
        <div class="ds-share flat" data-thread-key="2014/03/28/js-表达式和运算符/"
     data-title="js 表达式和运算符"
     data-content=""
     data-url="https://hongqinma.github.io/2014/03/28/js-表达式和运算符/">
  <div class="ds-share-inline">
    <ul  class="ds-share-icons-16">

      <li data-toggle="ds-share-icons-more"><a class="ds-more" href="javascript:void(0);">分享到：</a></li>
      <li><a class="ds-weibo" href="javascript:void(0);" data-service="weibo">微博</a></li>
      <li><a class="ds-qzone" href="javascript:void(0);" data-service="qzone">QQ空间</a></li>
      <li><a class="ds-qqt" href="javascript:void(0);" data-service="qqt">腾讯微博</a></li>
      <li><a class="ds-wechat" href="javascript:void(0);" data-service="wechat">微信</a></li>

    </ul>
    <div class="ds-share-icons-more">
    </div>
  </div>
</div>
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
      <div class="ds-thread" data-thread-key="2014/03/28/js-表达式和运算符/"
           data-title="js 表达式和运算符" data-url="https://hongqinma.github.io/2014/03/28/js-表达式和运算符/">
      </div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            Table of Contents
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            Overview
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel ">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="//schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/photo.jpg"
               alt="Hongqin Ma" />
          <p class="site-author-name" itemprop="name">Hongqin Ma</p>
          <p class="site-description motion-element" itemprop="description">Spell at all costs， to rush you in the future. </p>
        </div>
        <nav class="site-state motion-element">
          <div class="site-state-item site-state-posts">
            <a href="/archives">
              <span class="site-state-item-count">20</span>
              <span class="site-state-item-name">posts</span>
            </a>
          </div>

          
            <div class="site-state-item site-state-categories">
              <a href="/categories">
                <span class="site-state-item-count">3</span>
                <span class="site-state-item-name">categories</span>
              </a>
            </div>
          

          
            <div class="site-state-item site-state-tags">
              <a href="/tags">
                <span class="site-state-item-count">13</span>
                <span class="site-state-item-name">tags</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/HongqinMa" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://twitter.com/HongqinMa" target="_blank" title="Twitter">
                  
                    <i class="fa fa-fw fa-twitter"></i>
                  
                  Twitter
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://www.facebook.com/profile.php?id=100006581058735" target="_blank" title="Facebook">
                  
                    <i class="fa fa-fw fa-facebook"></i>
                  
                  Facebook
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://www.zhihu.com/people/HirakuMa" target="_blank" title="知乎">
                  
                    <i class="fa fa-fw fa-share-alt"></i>
                  
                  知乎
                </a>
              </span>
            
          
        </div>

        
        

        
        
          <div class="links-of-blogroll motion-element links-of-blogroll-inline">
            <div class="links-of-blogroll-title">
              <i class="fa  fa-fw fa-globe"></i>
              Links
            </div>
            <ul class="links-of-blogroll-list">
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.cnblogs.com/rubylouvre/" title="司徒正美" target="_blank">司徒正美</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.cnblogs.com/sanshi/" title="三生石上" target="_blank">三生石上</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.cnblogs.com/TomXu/" title="汤姆大叔" target="_blank">汤姆大叔</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://gold.xitu.io/" title="掘金" target="_blank">掘金</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://segmentfault.com/" title="segmentfault" target="_blank">segmentfault</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.jianshu.com/users/1cbb94e5ed4d/latest_articles" title="简书" target="_blank">简书</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://home.cnblogs.com/" title="博客园" target="_blank">博客园</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://www.awesomes.cn/" title="Awesomes" target="_blank">Awesomes</a>
                </li>
              
            </ul>
          </div>
        

      </section>

      
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">
            
              
            
            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#表达式"><span class="nav-number">1.</span> <span class="nav-text">表达式</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#原始表达式"><span class="nav-number">1.1.</span> <span class="nav-text">原始表达式</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#对象和数组的初始化表达式"><span class="nav-number">1.1.1.</span> <span class="nav-text">对象和数组的初始化表达式</span></a></li></ol></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#运算符"><span class="nav-number">2.</span> <span class="nav-text">运算符</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#比较、typeof、-、-、-、-、-、-、-、-、三元、逻辑运算符"><span class="nav-number">2.1.</span> <span class="nav-text">比较、typeof、+、-、*、/、%、=、==、===、三元、逻辑运算符</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#非"><span class="nav-number">2.1.1.</span> <span class="nav-text">非</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#与"><span class="nav-number">2.1.2.</span> <span class="nav-text">与</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#或"><span class="nav-number">2.1.3.</span> <span class="nav-text">或</span></a></li></ol></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#自增自减"><span class="nav-number">3.</span> <span class="nav-text">自增自减</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#带操作的赋值运算符"><span class="nav-number">3.1.</span> <span class="nav-text">带操作的赋值运算符</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#位操作符"><span class="nav-number">4.</span> <span class="nav-text">位操作符</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#instanceof-操作符"><span class="nav-number">5.</span> <span class="nav-text">instanceof 操作符</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#in-操作符"><span class="nav-number">6.</span> <span class="nav-text">in 操作符</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#操作符优先级"><span class="nav-number">7.</span> <span class="nav-text">操作符优先级</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#eval"><span class="nav-number">8.</span> <span class="nav-text">eval()</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#eval-1"><span class="nav-number">8.1.</span> <span class="nav-text">eval()</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#全局的-eval"><span class="nav-number">8.2.</span> <span class="nav-text">全局的 eval()</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#严格的-eval"><span class="nav-number">8.3.</span> <span class="nav-text">严格的 eval()</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#delete-运算符"><span class="nav-number">9.</span> <span class="nav-text">delete 运算符</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#void-运算符"><span class="nav-number">10.</span> <span class="nav-text">void 运算符</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#逗号运算符"><span class="nav-number">11.</span> <span class="nav-text">逗号运算符</span></a></li></ol></div>
            
          </div>
        </section>
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2016</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Hongqin Ma</span>
</div>

<div class="powered-by">
  Powered by <a class="theme-link" href="https://hexo.io">Hexo</a>
</div>

<div class="theme-info">
  Theme -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Muse
  </a>
</div>

<script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<span id="busuanzi_container_site_pv">
    &nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;Page Views: <span id="busuanzi_value_site_pv"></span> 
</span>

        

<div class="busuanzi-count">

  <script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>

  
    <span class="site-uv"><i class="fa fa-user"></i><span class="busuanzi-value" id="busuanzi_value_site_uv"></span></span>
  

  
    <span class="site-pv"><i class="fa fa-eye"></i><span class="busuanzi-value" id="busuanzi_value_site_pv"></span></span>
  
  
</div>



        
      </div>
    </footer>

    <div class="back-to-top">
      <i class="fa fa-arrow-up"></i>
    </div>
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  



  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.0.2"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.0.2"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.0.2"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.0.2"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.0.2"></script>



  

  
    
  

  <script type="text/javascript">
    var duoshuoQuery = {short_name:"Hiraku"};
    (function() {
      var ds = document.createElement('script');
      ds.type = 'text/javascript';ds.async = true;
      ds.id = 'duoshuo-script';
      ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
      ds.charset = 'UTF-8';
      (document.getElementsByTagName('head')[0]
      || document.getElementsByTagName('body')[0]).appendChild(ds);
    })();
  </script>

  
    
    <script src="/lib/ua-parser-js/dist/ua-parser.min.js?v=0.7.9"></script>
    <script src="/js/src/hook-duoshuo.js"></script>
  






  
  

  

  

  
  <script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.1.js"></script>
  <script>AV.initialize("PPmoIQxeu8Sd21h6Tl9TthNx-gzGzoHsz", "rTvbY2H7DvWzRipiBwn72RQ4");</script>
  <script>
    function showTime(Counter) {
      var query = new AV.Query(Counter);
      var entries = [];
      var $visitors = $(".leancloud_visitors");

      $visitors.each(function () {
        entries.push( $(this).attr("id").trim() );
      });

      query.containedIn('url', entries);
      query.find()
        .done(function (results) {
          var COUNT_CONTAINER_REF = '.leancloud-visitors-count';

          if (results.length === 0) {
            $visitors.find(COUNT_CONTAINER_REF).text(0);
            return;
          }

          for (var i = 0; i < results.length; i++) {
            var item = results[i];
            var url = item.get('url');
            var time = item.get('time');
            var element = document.getElementById(url);

            $(element).find(COUNT_CONTAINER_REF).text(time);
          }
          for(var i = 0; i < entries.length; i++) {
            var url = entries[i];
            var element = document.getElementById(url);
            var countSpan = $(element).find(COUNT_CONTAINER_REF);
            if( countSpan.text() == '') {
              countSpan.text(0);
            }
          }
        })
        .fail(function (object, error) {
          console.log("Error: " + error.code + " " + error.message);
        });
    }

    function addCount(Counter) {
      var $visitors = $(".leancloud_visitors");
      var url = $visitors.attr('id').trim();
      var title = $visitors.attr('data-flag-title').trim();
      var query = new AV.Query(Counter);

      query.equalTo("url", url);
      query.find({
        success: function(results) {
          if (results.length > 0) {
            var counter = results[0];
            counter.fetchWhenSave(true);
            counter.increment("time");
            counter.save(null, {
              success: function(counter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(counter.get('time'));
              },
              error: function(counter, error) {
                console.log('Failed to save Visitor num, with error message: ' + error.message);
              }
            });
          } else {
            var newcounter = new Counter();
            /* Set ACL */
            var acl = new AV.ACL();
            acl.setPublicReadAccess(true);
            acl.setPublicWriteAccess(true);
            newcounter.setACL(acl);
            /* End Set ACL */
            newcounter.set("title", title);
            newcounter.set("url", url);
            newcounter.set("time", 1);
            newcounter.save(null, {
              success: function(newcounter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(newcounter.get('time'));
              },
              error: function(newcounter, error) {
                console.log('Failed to create');
              }
            });
          }
        },
        error: function(error) {
          console.log('Error:' + error.code + " " + error.message);
        }
      });
    }

    $(function() {
      var Counter = AV.Object.extend("Counter");
      if ($('.leancloud_visitors').length == 1) {
        addCount(Counter);
      } else if ($('.post-title-link').length > 1) {
        showTime(Counter);
      }
    });
  </script>



  

  

  
  
  <!-- custom analytics part create by xiamo -->
<script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.1.js"></script>
<script>AV.initialize("PPmoIQxeu8Sd21h6Tl9TthNx-gzGzoHsz", "rTvbY2H7DvWzRipiBwn72RQ4");</script>
<script>
function showTime(Counter) {
  var query = new AV.Query(Counter);
  $(".leancloud_visitors").each(function() {
    var url = $(this).attr("id").trim();
    query.equalTo("url", url);
    query.find({
      success: function(results) {
        if (results.length == 0) {
          var content = '0 ' + $(document.getElementById(url)).text();
          $(document.getElementById(url)).text(content);
          return;
        }
        for (var i = 0; i < results.length; i++) {
          var object = results[i];
          var content = object.get('time') + ' ' + $(document.getElementById(url)).text();
          $(document.getElementById(url)).text(content);
        }
      },
      error: function(object, error) {
        console.log("Error: " + error.code + " " + error.message);
      }
    });

  });
}

function addCount(Counter) {
  var Counter = AV.Object.extend("Counter");
  url = $(".leancloud_visitors").attr('id').trim();
  title = $(".leancloud_visitors").attr('data-flag-title').trim();
  var query = new AV.Query(Counter);
  query.equalTo("url", url);
  query.find({
    success: function(results) {
      if (results.length > 0) {
        var counter = results[0];
        counter.fetchWhenSave(true);
        counter.increment("time");
        counter.save(null, {
          success: function(counter) {
            var content =  counter.get('time') + ' ' + $(document.getElementById(url)).text();
            $(document.getElementById(url)).text(content);
          },
          error: function(counter, error) {
            console.log('Failed to save Visitor num, with error message: ' + error.message);
          }
        });
      } else {
        var newcounter = new Counter();
        newcounter.set("title", title);
        newcounter.set("url", url);
        newcounter.set("time", 1);
        newcounter.save(null, {
          success: function(newcounter) {
              console.log("newcounter.get('time')="+newcounter.get('time'));
            var content = newcounter.get('time') + ' ' + $(document.getElementById(url)).text();
            $(document.getElementById(url)).text(content);
          },
          error: function(newcounter, error) {
            console.log('Failed to create');
          }
        });
      }
    },
    error: function(error) {
      console.log('Error:' + error.code + " " + error.message);
    }
  });
}
$(function() {
  var Counter = AV.Object.extend("Counter");
  if ($('.leancloud_visitors').length == 1) {
    addCount(Counter);
  } else if ($('.post-title-link').length > 1) {
    showTime(Counter);
  }
}); 
</script>

  
</body>
</html>
